package com.chushouya.manager.constants;

import com.general.framework.core.enums.IEnum;

import java.util.Objects;

/**
 * 发布状态(0待发送/1已发送/2发送失败)
 */
public enum NoticePublishStatusEnum implements IEnum<Integer> {

    un_publish(  0, "待发送"),
    publish(     1, "已发送"),
    publish_fail(2, "发送失败")
    ;

    private Integer value;

    private String desc;

    NoticePublishStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (NoticePublishStatusEnum thisEnum : NoticePublishStatusEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return "";
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
